package com.lt.test.provider.mapper;

import com.lt.test.entity.DO.RoleDO;
import com.lt.test.entity.DTO.CustomRole;
import com.lt.test.entity.QueryModel.PageQueryModel;

import java.util.List;
import java.util.Map;

/**
 * 角色相关
 * @author zhengchuan
 *
 */
public interface RoleMapper {
	
	/**
	 * 根据id查找权限
	 * @param roleId
	 * @return
	 * @throws Exception
	 */
	RoleDO findRoleById(String roleId) throws Exception;

	/**
	 * 获取角色列表用来展示
	 * @return
	 * @throws Exception
	 */
	List<RoleDO> getRoleForSelect() throws Exception;

    List<CustomRole> findRoleByPage(PageQueryModel pageQueryModel) throws Exception;

	int getRoleCount(PageQueryModel pageQueryModel) throws Exception;

    RoleDO findRoleByRoleKey(String roleKey) throws Exception;

	RoleDO findRoleByRoleName(String roleName) throws Exception;

	void editRoleInfo(CustomRole role) throws Exception;

	void insertRole(CustomRole role) throws Exception;

    List<Map<String,Object>> getPrivilegesByRoleId(String roleId) throws Exception;

	void doRoleAuthorization(Map<String, Object> checkedNodeObj) throws Exception;

	void doCancelRoleAuthorization(Map<String, Object> cancelCheckedNodeObj) throws Exception;
}
